<?php
	function print_attack_type ($name, $time, $atk, $color, &$combatLog)
	{
		if ( $color )
			$lastline = "[$time] <span class='line_attack' style='color: #004B7D;'> $name は、<b>$atk</b>で　相手を攻撃する。。。";
		else
			$lastline = "[$time] <span class='line_attack' style='color: #B93D00;'> $name は、<b>$atk</b>で　相手を攻撃する。。。";
		
		$combatLog .= $lastline;
		echo $lastline;
	}
	
	function print_defense_type($name, $deftype, &$combatLog)
	{
		$lastline = "$name desperately relies on his $deftype style...";
		$combatLog .= $lastline;
		echo $lastline;
	}
	
	function print_get_hit($name, $hp, $current, $dmg, &$combatLog)
	{
		$lastline = "but he gets successfully hit in tah face!</span><br>";
		$lastline .= "$name feels the pain and loses $dmg hitpoints. ($current/$hp)<br>";
		$combatLog .= $lastline;
		echo $lastline;
	}
	
	function print_get_bodyhit($name, &$combatLog)
	{
		$lastline = "but he gets successfully hit in tah body!</span><br>";
		$lastline .= "$name feels the pain and his speed and agility are greatly reduced. <br>";
		$combatLog .= $lastline;
		echo $lastline;
	}
	
	function print_get_defense(&$combatLog)
	{
		$lastline = "and succeeds in his defense, way to go !</span><br>";
		$combatLog .= $lastline;
		echo $lastline;
	}
	
	function print_partial_defense($hp, $current, $dmg, &$combatLog)
	{
		$lastline = "but only manages to stop the attack partially and takes $dmg hitpoints !</span> ($current/$hp)<br>";
		$combatLog .= $lastline;
		echo $lastline;
	}
	
	function print_start_secs($time, &$combatLog)
	{
		$lastline = "$time seconds pass before they start moving !!<br>";
		$combatLog .= $lastline;
		echo $lastline;
	}
	
	function print_starts_attack($name, &$combatLog)
	{
		$lastline = "$name starts the attack !! <br>";
		$combatLog .= $lastline;
		echo $lastline;
	}
	
	function print_send_counter($name, $hitpoints, &$combatLog)
	{
		$lastline = "dodges his attack and quickly sends a Counter to his opponent. </span><br>";
		$lastline .= "$name gets hit in tah face and loses $hitpoints hitpoints.<br>";
		$combatLog .= $lastline;
		echo $lastline;
	}
	
	function print_takes_advantadge($name, $time, &$combatLog)
	{
		$lastline = "[$time] $name quickly takes advantadge and starts attacking.<br>";
		$combatLog .= $lastline;
		echo $lastline;
	}
	
	function print_clinch($name, $clinchtime, &$combatLog)
	{
		$lastline = "$name runs like a pussy and clinches to his opponent for $clinchtime seconds before he gets hit ! </span><br>";
		$combatLog .= $lastline;
		echo $lastline;
	}
	
	function print_ropes($name, $hitpoints, &$combatLog)
	{
		$lastline = "$name somehow ends up in the ropes which makes him take a hit from his opponent and loses $hitpoints hitpoints !! ";
		$combatLog .= $lastline;
		echo $lastline;
	}
	
	function print_stare($name1, $name2, $time, &$combatLog)
	{
		$lastline = "[$time] $name1 and $name2 stare at each other with murderous intentions.<br>";
		$combatLog .= $lastline;
		echo $lastline;
	}
	
	function print_down_stop($name, &$combatLog, $again = 0)
	{
		if ( $again )
			$lastline = "$name goes DOWN again and the referee stops the match. </span><br>";
		else
			$lastline = "$name goes DOWN and the referee stops the match. </span><br>";
		$combatLog .= $lastline;
		echo $lastline;
	}
	
	function print_down_count($name, &$combatLog, $span = 1)
	{
		if ( $span )
			$lastline = "$name goes DOWN and the referee starts counting: </span><br>";
		else
			$lastline = "$name goes DOWN and the referee starts counting: <br>";
		$combatLog .= $lastline;
		echo $lastline;
	}
	
	function print_stand($name, &$combatLog)
	{
		$lastline = "$name stands up and readys his stance ! He looks damaged !!<br>";
		$combatLog .= $lastline;
		echo $lastline;
	}
	
	function print_enrage($name, &$combatLog)
	{
		$lastline = "$name enrages after his last down, lowers his defense and starts attacking recklessly !!<br>";
		$combatLog .= $lastline;
		echo $lastline;
	}
	
	function print_awesome_hit($name, $hitpoints, $hp, $current, &$combatLog)
	{
		$lastline = "$name lost $hitpoints hitpoints in this awesome hit ! ($current/$hp)<br>";
		$combatLog .= $lastline;
		echo $lastline;
	}
	
	function print_ko_win($name, &$combatLog)
	{
		$lastline .= "-------------------------<br>";
		$lastline .= "K.O. !! <br>";
		$lastline .= "<b>$name</b> wins the match ! <br>";
		$combatLog .= $lastline;
		echo $lastline;
	}
	
	function print_stand_heroic($name, &$combatLog)
	{
		$lastline = "$name pulls himself together and stands up trembling !! Will he turn the tides? <br>";
		$combatLog .= $lastline;
		echo $lastline;
	}
	
	function print_stop_win($loser, $winner, &$combatLog)
	{
		$lastline = "-------------------------<br>";
		$lastline .= "RFEREE STOPS THE MATCH <br>";
		$lastline .= "$loser can't continue and <b>$winner</b> wins the match ! <br>";
		$combatLog .= $lastline;
		echo $lastline;
	}
	
	function print_end_round($round, $name1, $name2, $percent1, $percent2, &$combatLog)
	{
		$lastline = "-------------------------<br>";
		$lastline .= "END OF ROUND $round !! <br>";
		$lastline .= "-------------------------<br>";
		$lastline .= "$name1 healed for $percent1<br>";
		$lastline .= "$name2 healed for $percent2<br>";
		
		$combatLog .= $lastline;
		echo $lastline;
	}
	
	function print_end_round2(&$combatLog)
	{
		$lastline = "-----------------------<br>";
		$combatLog .= $lastline;
		echo $lastline;	
	}
	
	function print_stat_recovery($name, &$combatLog)
	{
		$lastline = "$name managed to get his speed and agility back !<br>";
		$combatLog .= $lastline;
		echo $lastline;
	}
	
	function print_winner_points($name1, $name2, $points1, $points2, &$combatLog)
	{
		$lastline = "-------------------------<br>";
		$lastline .= "END OF THE MATCH !! <br>";
		if ( $points1 > $points2 )
			$lastline .= "The judges decided that $name1 won the match with a point advantadge of $points1 - $points2. <br>";
		else if ( $points2 > $points1 )
			$lastline .= "The judges decided that $name2 won the match with a point advantadge of $points2 - $points1. <br>";
		else
			$lastline .= "The judges decided that both suck so much that this draw must be resolved by being shot outside. <br>";
			
		$lastline .= "-------------------------<br>";
		$combatLog .= $lastline;
		echo $lastline;
	}
	
	function print_win_tko($name1, $name2, $down1, &$combatLog)
	{
		$lastline = "<br>-------------------------<br>";
		$lastline .= "TECHNICAL K.O. !! <br>";
		$lastline .= "END OF THE MATCH !! <br>";
		if ( $down1 == 3 )
			$lastline .= "$name2 wins the match ! <br>";
		else
			$lastline .= "$name1 wins the match ! <br>";
		$lastline .= "-------------------------<br>";
		$combatLog .= $lastline;
		echo $lastline;	
	}
	
	function downCount($countEnd, &$combatLog)
	{
		for ($k=1; $k <= $countEnd; $k++)
		{
			if ( $k <= 4 )
			{
				$lastline = "$k ! <br>";
				$combatLog .= $lastline;
				echo $lastline;
			}
			else if ( $k > 4 && $k <= 6 )
			{
				$lastline = "$k !! <br>";
				$combatLog .= $lastline;
				echo $lastline;
			}
			else if ( $k > 6 )
			{
				$lastline = "$k !!! <br>";
				$combatLog .= $lastline;
				echo $lastline;
			}
			sleep(2);
			$combatLog .= "SLEEP 2<br>";
		}
	}

?>